import socket

udp = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# print(udp)
if __name__ == '__main__':
    data = input("请输入发送内容")
    udp.bind(("", 6666))
    udp.sendto(data.encode("gbk"), ('192.168.3.1', 8080))
    # udp.bind(("", 6666))
    # while True:
    #     recv_data = udp.recvfrom(1024)
    #     print(recv_data)
    #     msg = recv_data[0]
    #     print(msg.decode("gbk"))
    udp.close()
